package com.qigao.mall.web.job;

import com.qigao.mall.api.OrderService;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author luiz
 * @Title: com.qigao.mall.web.job
 * @ProjectName three-mall
 * @date 2019-11-2019/11/20 10:42
 * @Description: 订单相关的定时任务
 */
@Component
public class OrderJob {
    @Resource
    private OrderService orderService;
    /**
     * 刷新订单过期状态
     * 每个180秒检查订单状态
     */
  //  @Scheduled(fixedRate = 180000)
    public void refreshOrderOverTime(){
        orderService.refreshOrderOverTime();
    }

    /**
     * 发货超过七天自动收货
     * 每天早上一点十分执行
     */
   // @Scheduled(cron = "0 10 1 0/5 * ?")
    public void closeOrder(){
        orderService.autoRecvOrder();
    }
}
